package com.example.demo.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.demo.dao.PoetryDao;
import com.example.demo.pojo.Poetry;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PoetryServiceImpl implements  PoetryService {
    @Autowired
    private PoetryDao poetryDao;

    @Override
    public Page<Poetry> listall(Integer pageing) {
        QueryWrapper<Poetry> map = new QueryWrapper<>();
        Page<Poetry> poetryPage = new Page<Poetry>(pageing,2);
        Page<Poetry> poetrylist = poetryDao.selectPage(poetryPage,map);
        return poetrylist;
    }
}
